
public class buildDB {
	
	public static void main(String[] args){
		
		
		
		//Taking the directory path where input files are stored.
		if(args.length == 1){
			String collectionNamePath = args[0];
			
			//calling scanner class
			ColScanner scan = new ColScanner(collectionNamePath);
			scan.build();					//Begins building the index files.
			
			IndexBuilder ib = new IndexBuilder(collectionNamePath);
			ib.buildIndex();    			//Build the main index file
			
			if(Settings.stats){
				System.out.println();
				System.out.println("**********Statistics**********");
				System.out.println("# of documents in the collection = "+Settings.no_documents);
				System.out.println("# of paragraphs in the collection = "+Settings.no_paragraphs);
				System.out.println("# of entries in the Index table = " + Settings.no_entriesInIndex);
				System.out.println("# of posting file entries = " + Settings.no_entries_PostFile);
				//System.out.println("Size of hash table = "+Settings.no_entriesInIndex);
				System.out.println("# of collisions for hashing = "+Settings.collision_no);
				System.out.println("maximum hash value = "+Settings.collision_max);
				System.out.println("average hash value = "+Settings.collison_avg);
				System.out.println();
			}
			System.out.println("Database built.");
		}
		else{
			System.out.println("Improper command line arguments set");
			
		}
		
	}

}

